初始化项目版本
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# Architecture Quality Gate
|
||||
|
||||
### Structural integrity
|
||||
- [ ] Logic extracted to custom hooks in `src/hooks/`.
|
||||
- [ ] No monolithic files; strictly Atomic/Composite modularity.
|
||||
- [ ] All static text/URLs moved to `src/data/mockData.ts`.
|
||||
|
||||
### Type safety and syntax
|
||||
- [ ] Props use `Readonly<T>` interfaces.
|
||||
- [ ] File is syntactically valid TypeScript (no red squiggles).
|
||||
- [ ] Placeholders from templates (e.g., `StitchComponent`) have been replaced with actual names.
|
||||
|
||||
### Styling and theming
|
||||
- [ ] Dark mode (`dark:`) applied to all color classes.
|
||||
- [ ] No hardcoded hex values; use theme-mapped Tailwind classes.
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright 2026 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
// Use a valid identifier like 'StitchComponent' as the placeholder
|
||||
interface StitchComponentProps {
|
||||
readonly children?: React.ReactNode;
|
||||
readonly className?: string;
|
||||
}
|
||||
|
||||
export const StitchComponent: React.FC<StitchComponentProps> = ({
|
||||
children,
|
||||
className = '',
|
||||
...props
|
||||
}) => {
|
||||
return (
|
||||
<div className={`relative ${className}`} {...props}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default StitchComponent;
|
||||
@@ -0,0 +1,14 @@
|
||||
# Stitch API reference
|
||||
|
||||
This document describes the data structures returned by the Stitch MCP server to ensure accurate component mapping.
|
||||
|
||||
### Metadata schema
|
||||
When calling `get_screen`, the server returns a JSON object with these key properties:
|
||||
* **htmlCode**: Contains a `downloadUrl`. This is a signed URL that requires a system-level fetch (curl) to handle redirects and security handshakes.
|
||||
* **screenshot**: Includes a `downloadUrl` for the visual design. Use this to verify layout intent that might not be obvious in the raw HTML.
|
||||
* **deviceType**: Usually set to `DESKTOP`. All generated components should prioritize the corresponding viewport (2560px width) as the base layout.
|
||||
|
||||
### Technical mapping rules
|
||||
1. **Element tracking**: Preserve `data-stitch-id` attributes as comments in the TSX to allow for future design synchronization.
|
||||
2. **Asset handling**: Treat background images in the HTML as dynamic data. Extract the URLs into `mockData.ts` rather than hardcoding them into the component styles.
|
||||
3. **Style extraction**: The HTML `<head>` contains a localized `tailwind.config`. This config must be merged with the local project theme to ensure colors like `primary` and `background-dark` render correctly.
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"theme": {
|
||||
"colors": {
|
||||
"primary": "#19e66f",
|
||||
"background": {
|
||||
"light": "#f6f8f7",
|
||||
"dark": "#112118",
|
||||
"elevated": "#1A1A1A"
|
||||
},
|
||||
"accent": {
|
||||
"purple": "#8A2BE2",
|
||||
"lavender": "#D0A9F5"
|
||||
}
|
||||
},
|
||||
"typography": {
|
||||
"display": [
|
||||
"Space Grotesk",
|
||||
"sans-serif"
|
||||
],
|
||||
"icons": "Material Symbols Outlined"
|
||||
},
|
||||
"spacing": {
|
||||
"header-h": "72px",
|
||||
"container-max": "960px"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user