@qingchen3020/test-package 1.0.0

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 (3) hide show
  1. package/index.d.ts +14 -0
  2. package/index.js +40 -0
  3. package/package.json +20 -0
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ interface TestButtonProps {
4
+ label?: string;
5
+ onClick?: () => void;
6
+ }
7
+
8
+ interface TestCardProps {
9
+ title: string;
10
+ children?: React.ReactNode;
11
+ }
12
+
13
+ export function TestButton(props: TestButtonProps): JSX.Element;
14
+ export function TestCard(props: TestCardProps): JSX.Element;
package/index.js ADDED
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+
3
+ // 一个简单的按钮组件
4
+ export function TestButton({ label = 'Click Me', onClick }) {
5
+ return (
6
+ <button
7
+ onClick={onClick}
8
+ style={{
9
+ padding: '10px 20px',
10
+ backgroundColor: '#007bff',
11
+ color: 'white',
12
+ border: 'none',
13
+ borderRadius: '5px',
14
+ cursor: 'pointer',
15
+ fontSize: '16px'
16
+ }}
17
+ >
18
+ {label}
19
+ </button>
20
+ );
21
+ }
22
+
23
+ // 一个简单的卡片组件
24
+ export function TestCard({ title, children }) {
25
+ return (
26
+ <div
27
+ style={{
28
+ border: '1px solid #ddd',
29
+ borderRadius: '8px',
30
+ padding: '20px',
31
+ margin: '10px',
32
+ backgroundColor: '#fff',
33
+ boxShadow: '0 2px 4px rgba(0,0,0,0.1)'
34
+ }}
35
+ >
36
+ <h3 style={{ margin: '0 0 10px 0', color: '#333' }}>{title}</h3>
37
+ <div>{children}</div>
38
+ </div>
39
+ );
40
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@qingchen3020/test-package",
3
+ "version": "1.0.0",
4
+ "description": "A test React component package for Figma Make",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "keywords": [
11
+ "react",
12
+ "components",
13
+ "test"
14
+ ],
15
+ "author": "qingchen3020",
16
+ "license": "ISC",
17
+ "peerDependencies": {
18
+ "react": "^19.2.6"
19
+ }
20
+ }