sparkdesign 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/cli/dist/index.js +0 -0
- package/cli/dist/utils/tokens.js +103 -17
- package/cli/registry/basic/button.test.tsx +333 -0
- package/cli/registry/chat/{question-part.tsx → ask-user-part.tsx} +4 -4
- package/cli/registry/chat/{browser-use-part.tsx → browser-action-part.tsx} +6 -6
- package/cli/registry/chat/{suggestion-part.tsx → hint-banner.tsx} +4 -4
- package/cli/registry/chat/markdown.test.tsx +387 -0
- package/cli/registry/chat/{reasoning-step.tsx → reasoning-step/compound.tsx} +163 -185
- package/cli/registry/chat/reasoning-step/context.tsx +114 -0
- package/cli/registry/chat/reasoning-step/index.tsx +45 -0
- package/cli/registry/chat/reasoning-step/types.ts +109 -0
- package/cli/registry/chat/response/compound.tsx +210 -0
- package/cli/registry/chat/{response.tsx → response/context.tsx} +65 -136
- package/cli/registry/chat/response/index.tsx +87 -0
- package/cli/registry/chat/response/types.ts +123 -0
- package/cli/registry/chat/thinking-indicator.test.tsx +244 -0
- package/cli/registry/chat/tool-invocation-card.test.tsx +346 -0
- package/cli/registry/chat/{request.tsx → user-message.tsx} +3 -3
- package/cli/registry/chat/user-question/compound.tsx +324 -0
- package/cli/registry/chat/user-question/context.tsx +456 -0
- package/cli/registry/chat/user-question/index.tsx +71 -316
- package/cli/registry/chat/user-question/useUserQuestionKeyboard.ts +5 -6
- package/cli/registry/tokens/index.css +31 -0
- package/cli/registry/tokens/scale/computed.css +103 -0
- package/cli/registry/tokens/scale/config.css +110 -0
- package/cli/registry/tokens/scale/index.css +30 -0
- package/cli/registry/tokens/scale/presets/compact.css +30 -0
- package/cli/registry/tokens/scale/presets/dense.css +64 -0
- package/cli/registry/tokens/scale/presets/sharp.css +40 -0
- package/cli/registry/tokens/scale/presets/soft.css +16 -0
- package/cli/registry/tokens/scale.css +12 -298
- package/cli/registry/tokens/scrollbar-utility.css +35 -0
- package/cli/registry/tokens/themes/dark-parchment.css +132 -0
- package/cli/registry/tokens/themes/dark-qoder.css +132 -0
- package/cli/registry/tokens/themes/light-parchment.css +123 -0
- package/cli/registry/tokens/themes/light-qoder.css +131 -0
- package/dist/qoder-design.css +1 -1
- 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/{suggestion-part.d.ts → hint-banner.d.ts} +4 -4
- 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/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/user-message.d.ts +6 -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 +13 -5
- package/dist/registry/chat/user-question/useUserQuestionKeyboard.d.ts +2 -3
- package/dist/scale.css +9 -303
- package/dist/spark-design.cjs.js +62 -62
- package/dist/spark-design.es.js +3992 -3826
- 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/HintBanner/index.d.ts +6 -0
- package/dist/src/components/chat/ReasoningStep/index.d.ts +11 -5
- package/dist/src/components/chat/Response/index.d.ts +16 -6
- package/dist/src/components/chat/UserMessage/index.d.ts +7 -0
- package/dist/src/components/chat/UserQuestion/index.d.ts +18 -4
- package/dist/src/components/index.d.ts +63 -63
- package/dist/theme.css +13 -800
- package/package.json +27 -3
- package/dist/registry/chat/browser-use-part.d.ts +0 -28
- package/dist/registry/chat/question-part.d.ts +0 -24
- package/dist/registry/chat/reasoning-step.d.ts +0 -35
- package/dist/registry/chat/request.d.ts +0 -6
- package/dist/registry/chat/response.d.ts +0 -28
- package/dist/src/components/chat/BrowserUsePart/index.d.ts +0 -7
- package/dist/src/components/chat/QuestionPart/index.d.ts +0 -6
- package/dist/src/components/chat/Request/index.d.ts +0 -7
- package/dist/src/components/chat/SuggestionPart/index.d.ts +0 -6
- /package/dist/src/components/{foundation → basic}/AlertDialog/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Avatar/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Button/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Collapse/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Collapsible/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/CollapsibleSection/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/DropdownMenu/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/EllipsisText/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/IconButton/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Kbd/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/OptionList/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Pagination/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Progress/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/RadioGroup/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Resizable/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Scrollbar/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Select/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Skeleton/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Slider/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Spinner/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Switch/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Table/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Tabs/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Tag/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Toast/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Toggle/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Tooltip/index.d.ts +0 -0
- /package/dist/src/components/{foundation → basic}/Typography/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparkdesign",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Modern React Design System with dual-dimension theme system",
|
|
6
6
|
"keywords": [
|
|
@@ -42,12 +42,22 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "vite",
|
|
44
44
|
"check:registry": "node scripts/check-registry-sync.mjs",
|
|
45
|
+
"check:showcase": "node scripts/check-showcase-sync.mjs",
|
|
46
|
+
"gen:demo": "node scripts/gen-demo.mjs",
|
|
45
47
|
"build": "vite build && npx @tailwindcss/cli -i src/lib.css -o dist/qoder-design.css --minify && tsc -p tsconfig.lib.json && npm run build:cli",
|
|
46
48
|
"build:cli": "cd cli && npm run build",
|
|
47
49
|
"build:css": "npx @tailwindcss/cli -i src/lib.css -o dist/qoder-design.css --minify",
|
|
48
50
|
"build:watch": "vite build --watch",
|
|
49
51
|
"preview": "vite preview",
|
|
50
52
|
"lint": "eslint .",
|
|
53
|
+
"test": "vitest",
|
|
54
|
+
"test:run": "vitest run",
|
|
55
|
+
"test:ui": "vitest --ui",
|
|
56
|
+
"test:coverage": "vitest run --coverage",
|
|
57
|
+
"test:e2e": "playwright test",
|
|
58
|
+
"test:e2e:ui": "playwright test --ui",
|
|
59
|
+
"size": "size-limit",
|
|
60
|
+
"size:why": "size-limit --why",
|
|
51
61
|
"prepublishOnly": "npm run build && node scripts/sync-registry-to-cli.mjs"
|
|
52
62
|
},
|
|
53
63
|
"peerDependencies": {
|
|
@@ -100,19 +110,33 @@
|
|
|
100
110
|
"tailwindcss-animate": "^1.0.7"
|
|
101
111
|
},
|
|
102
112
|
"devDependencies": {
|
|
113
|
+
"@axe-core/playwright": "^4.11.1",
|
|
103
114
|
"@eslint/js": "^9.39.1",
|
|
115
|
+
"@playwright/test": "^1.58.2",
|
|
116
|
+
"@size-limit/file": "^12.0.0",
|
|
104
117
|
"@tailwindcss/cli": "^4.1.18",
|
|
105
118
|
"@tailwindcss/vite": "^4.1.18",
|
|
106
119
|
"@types/node": "^24.10.13",
|
|
107
120
|
"@types/react": "^19.2.7",
|
|
108
121
|
"@types/react-dom": "^19.2.3",
|
|
109
122
|
"@vitejs/plugin-react": "^5.1.1",
|
|
123
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
110
124
|
"eslint": "^9.39.1",
|
|
111
125
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
112
126
|
"eslint-plugin-react-refresh": "^0.4.24",
|
|
113
127
|
"globals": "^16.5.0",
|
|
128
|
+
"size-limit": "^12.0.0",
|
|
114
129
|
"typescript": "~5.9.3",
|
|
115
130
|
"typescript-eslint": "^8.48.0",
|
|
116
|
-
"vite": "^7.3.1"
|
|
117
|
-
|
|
131
|
+
"vite": "^7.3.1",
|
|
132
|
+
"vitest": "^4.0.18"
|
|
133
|
+
},
|
|
134
|
+
"size-limit": [
|
|
135
|
+
{
|
|
136
|
+
"path": "dist/spark-design.es.js",
|
|
137
|
+
"limit": "550 KB",
|
|
138
|
+
"brotli": false,
|
|
139
|
+
"gzip": false
|
|
140
|
+
}
|
|
141
|
+
]
|
|
118
142
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [INPUT]: (BrowserUsePartProps) - description、content、status;可选 normalIcon/failedIcon/skippedIcon,未指定则用内联 SVG
|
|
3
|
-
* [OUTPUT]: (JSX.Element)
|
|
4
|
-
* [POS]: registry/chat - 从 QodeChatPanel 移植,全 token 化
|
|
5
|
-
*/
|
|
6
|
-
import { type ReactNode } from 'react';
|
|
7
|
-
export type BrowserUseStatus = 'normal' | 'failed' | 'skipped';
|
|
8
|
-
export interface BrowserUsePartProps {
|
|
9
|
-
description?: string;
|
|
10
|
-
content?: string;
|
|
11
|
-
status?: BrowserUseStatus;
|
|
12
|
-
onRun?: () => void;
|
|
13
|
-
onSkip?: () => void;
|
|
14
|
-
onViewDetail?: () => void;
|
|
15
|
-
onAskEveryTimeChange?: (value: string) => void;
|
|
16
|
-
className?: string;
|
|
17
|
-
/** 供 Select 下拉浮层继承布局风格(如 dense),不传则从 document 读取 */
|
|
18
|
-
dataStyle?: string;
|
|
19
|
-
/** 供 Select 下拉浮层继承颜色主题,不传则从 document 读取 */
|
|
20
|
-
dataTheme?: string;
|
|
21
|
-
normalIcon?: ReactNode;
|
|
22
|
-
failedIcon?: ReactNode;
|
|
23
|
-
skippedIcon?: ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare function BrowserUsePart({ description, content, status, onRun, onSkip, onViewDetail, onAskEveryTimeChange, className, dataStyle, dataTheme, normalIcon, failedIcon, skippedIcon, }: BrowserUsePartProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare namespace BrowserUsePart {
|
|
27
|
-
var displayName: string;
|
|
28
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [INPUT]: (QuestionPartProps) - title、question、skipText/runText;可选 headerIcon,未指定则用内联 SVG
|
|
3
|
-
* [OUTPUT]: (JSX.Element)
|
|
4
|
-
* [POS]: registry/chat - 从 QodeChatPanel 移植,全 token 化
|
|
5
|
-
*/
|
|
6
|
-
import type { ReactNode } from 'react';
|
|
7
|
-
export interface QuestionPartProps {
|
|
8
|
-
title?: string;
|
|
9
|
-
question: string;
|
|
10
|
-
skipText?: string;
|
|
11
|
-
runText?: string;
|
|
12
|
-
askTimeText?: string;
|
|
13
|
-
onSkip?: () => void;
|
|
14
|
-
onRun?: () => void;
|
|
15
|
-
onAskTimeChange?: (value: string) => void;
|
|
16
|
-
contentMaxHeight?: number;
|
|
17
|
-
collapsible?: boolean;
|
|
18
|
-
className?: string;
|
|
19
|
-
headerIcon?: ReactNode;
|
|
20
|
-
}
|
|
21
|
-
export declare function QuestionPart({ title, question, skipText, runText, askTimeText, onSkip, onRun, contentMaxHeight, collapsible, className, headerIcon, }: QuestionPartProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare namespace QuestionPart {
|
|
23
|
-
var displayName: string;
|
|
24
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
export type ReasoningStepDetail = {
|
|
3
|
-
type: 'action';
|
|
4
|
-
action: string;
|
|
5
|
-
desc?: string;
|
|
6
|
-
details?: ReasoningStepDetail[];
|
|
7
|
-
} | {
|
|
8
|
-
type: 'file';
|
|
9
|
-
filename: string;
|
|
10
|
-
lines?: string;
|
|
11
|
-
path?: string;
|
|
12
|
-
fileType?: string;
|
|
13
|
-
details?: ReasoningStepDetail[];
|
|
14
|
-
};
|
|
15
|
-
export interface ReasoningStepProps {
|
|
16
|
-
text: ReactNode;
|
|
17
|
-
description?: string;
|
|
18
|
-
status?: 'completed' | 'in-progress';
|
|
19
|
-
icon?: ReactNode;
|
|
20
|
-
showIcon?: boolean;
|
|
21
|
-
details?: ReasoningStepDetail[];
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
duration?: number;
|
|
24
|
-
spread?: number;
|
|
25
|
-
disableExpandAnimation?: boolean;
|
|
26
|
-
defaultExpanded?: boolean;
|
|
27
|
-
expanded?: boolean;
|
|
28
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
29
|
-
eyeIcon?: ReactNode;
|
|
30
|
-
arrowRightIcon?: ReactNode;
|
|
31
|
-
}
|
|
32
|
-
export declare function ReasoningStep({ text, description, status, icon, showIcon, details, children, duration, spread, disableExpandAnimation, defaultExpanded, expanded: expandedProp, onExpandedChange, eyeIcon, arrowRightIcon, }: ReasoningStepProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare namespace ReasoningStep {
|
|
34
|
-
var displayName: string;
|
|
35
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface RequestProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
maxWidth?: string | number;
|
|
5
|
-
}
|
|
6
|
-
export declare const Request: import("react").ForwardRefExoticComponent<RequestProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type { ReasoningStepDetail } from './reasoning-step';
|
|
3
|
-
export type ResponsePhase = 'thinking' | 'streaming' | 'done' | 'imageGenerating';
|
|
4
|
-
export type ResponseStepToolType = 'read' | 'edit' | 'search';
|
|
5
|
-
export interface ResponseStep {
|
|
6
|
-
text: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
details?: ReasoningStepDetail[];
|
|
9
|
-
toolType?: ResponseStepToolType;
|
|
10
|
-
}
|
|
11
|
-
export interface ResponseRound {
|
|
12
|
-
step: ResponseStep;
|
|
13
|
-
simpleMd: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ResponseProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
-
simulate?: boolean;
|
|
17
|
-
phase?: ResponsePhase;
|
|
18
|
-
rounds?: ResponseRound[];
|
|
19
|
-
finalMarkdown?: string;
|
|
20
|
-
onSimulateComplete?: () => void;
|
|
21
|
-
onStepChange?: (text: string, toolType?: ResponseStepToolType) => void;
|
|
22
|
-
/** 主库可注入带 Lottie 的 ThinkingIndicator,与独立 ThinkingIndicator 动效一致 */
|
|
23
|
-
thinkingIndicator?: ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare function Response({ simulate, phase, rounds, finalMarkdown, onSimulateComplete, onStepChange, thinkingIndicator, className, ...props }: ResponseProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare namespace Response {
|
|
27
|
-
var displayName: string;
|
|
28
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BrowserUsePartProps as RegistryBrowserUsePartProps, BrowserUseStatus } from '../../../../registry/chat/browser-use-part';
|
|
2
|
-
export type { BrowserUseStatus };
|
|
3
|
-
export type BrowserUsePartProps = Omit<RegistryBrowserUsePartProps, 'normalIcon' | 'failedIcon' | 'skippedIcon'>;
|
|
4
|
-
export declare function BrowserUsePart(props: BrowserUsePartProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare namespace BrowserUsePart {
|
|
6
|
-
var displayName: string;
|
|
7
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { QuestionPartProps as RegistryQuestionPartProps } from '../../../../registry/chat/question-part';
|
|
2
|
-
export type QuestionPartProps = Omit<RegistryQuestionPartProps, 'headerIcon'>;
|
|
3
|
-
export declare function QuestionPart(props: QuestionPartProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare namespace QuestionPart {
|
|
5
|
-
var displayName: string;
|
|
6
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { SuggestionPartProps } from '../../../../registry/chat/suggestion-part';
|
|
2
|
-
export type { SuggestionPartProps };
|
|
3
|
-
export declare function SuggestionPart(props: Omit<SuggestionPartProps, 'closeIcon' | 'arrowDownSIcon' | 'suggestionIcon'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare namespace SuggestionPart {
|
|
5
|
-
var displayName: string;
|
|
6
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|