react-smart-paste 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,230 @@
1
+ .rsp {
2
+ --rsp-bg: #ffffff;
3
+ --rsp-fg: #1f2328;
4
+ --rsp-muted: #656d76;
5
+ --rsp-border: #d0d7de;
6
+ --rsp-hover: #f3f4f6;
7
+ --rsp-accent: #2563eb;
8
+ --rsp-on-accent: #ffffff;
9
+ --rsp-danger: #b42318;
10
+ --rsp-radius: 8px;
11
+ --rsp-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 12px 32px -8px rgb(0 0 0 / 0.22);
12
+ --rsp-font: inherit;
13
+
14
+ position: relative;
15
+ display: inline-block;
16
+ font-family: var(--rsp-font);
17
+ font-size: 14px;
18
+ line-height: 1.4;
19
+ color: var(--rsp-fg);
20
+ }
21
+
22
+ @media (prefers-color-scheme: dark) {
23
+ .rsp:not([data-theme="light"]) {
24
+ --rsp-bg: #1c1f24;
25
+ --rsp-fg: #e6edf3;
26
+ --rsp-muted: #9198a1;
27
+ --rsp-border: #3d444d;
28
+ --rsp-hover: #2a2f36;
29
+ --rsp-accent: #6ea8fe;
30
+ --rsp-on-accent: #0b1220;
31
+ --rsp-danger: #ff8a80;
32
+ --rsp-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px -8px rgb(0 0 0 / 0.8);
33
+ }
34
+ }
35
+
36
+ .rsp[data-theme="dark"] {
37
+ --rsp-bg: #1c1f24;
38
+ --rsp-fg: #e6edf3;
39
+ --rsp-muted: #9198a1;
40
+ --rsp-border: #3d444d;
41
+ --rsp-hover: #2a2f36;
42
+ --rsp-accent: #6ea8fe;
43
+ --rsp-on-accent: #0b1220;
44
+ --rsp-danger: #ff8a80;
45
+ --rsp-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 12px 32px -8px rgb(0 0 0 / 0.8);
46
+ }
47
+
48
+ .rsp button,
49
+ .rsp textarea {
50
+ font: inherit;
51
+ color: inherit;
52
+ }
53
+
54
+ .rsp-button,
55
+ .rsp-primary,
56
+ .rsp-ghost {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ gap: 6px;
60
+ height: 34px;
61
+ padding: 0 12px;
62
+ border: 1px solid var(--rsp-border);
63
+ border-radius: var(--rsp-radius);
64
+ background: var(--rsp-bg);
65
+ font-weight: 600;
66
+ white-space: nowrap;
67
+ cursor: pointer;
68
+ }
69
+
70
+ .rsp-button:hover:not(:disabled),
71
+ .rsp-ghost:hover:not(:disabled) {
72
+ background: var(--rsp-hover);
73
+ }
74
+
75
+ .rsp-button svg {
76
+ color: var(--rsp-accent);
77
+ }
78
+
79
+ .rsp-primary {
80
+ border-color: var(--rsp-accent);
81
+ background: var(--rsp-accent);
82
+ color: var(--rsp-on-accent) !important;
83
+ }
84
+
85
+ .rsp button:disabled {
86
+ opacity: 0.55;
87
+ cursor: default;
88
+ }
89
+
90
+ .rsp button:focus-visible,
91
+ .rsp textarea:focus-visible,
92
+ .rsp input:focus-visible {
93
+ outline: 2px solid var(--rsp-accent);
94
+ outline-offset: 2px;
95
+ }
96
+
97
+ .rsp-panel {
98
+ position: absolute;
99
+ top: calc(100% + 6px);
100
+ left: 0;
101
+ z-index: 50;
102
+ box-sizing: border-box;
103
+ width: 320px;
104
+ max-width: calc(100vw - 32px);
105
+ padding: 14px;
106
+ border: 1px solid var(--rsp-border);
107
+ border-radius: calc(var(--rsp-radius) + 4px);
108
+ background: var(--rsp-bg);
109
+ box-shadow: var(--rsp-shadow);
110
+ text-align: left;
111
+ }
112
+
113
+ .rsp-panel[data-align="end"] {
114
+ left: auto;
115
+ right: 0;
116
+ }
117
+
118
+ .rsp-title {
119
+ display: flex;
120
+ align-items: center;
121
+ gap: 8px;
122
+ margin: 0;
123
+ font-weight: 600;
124
+ }
125
+
126
+ .rsp-title[data-tone="danger"] {
127
+ color: var(--rsp-danger);
128
+ }
129
+
130
+ .rsp-spinner {
131
+ flex: none;
132
+ width: 14px;
133
+ height: 14px;
134
+ border: 2px solid var(--rsp-border);
135
+ border-top-color: var(--rsp-accent);
136
+ border-radius: 50%;
137
+ animation: rsp-spin 0.8s linear infinite;
138
+ }
139
+
140
+ @keyframes rsp-spin {
141
+ to {
142
+ transform: rotate(360deg);
143
+ }
144
+ }
145
+
146
+ .rsp-changes {
147
+ max-height: 260px;
148
+ margin: 10px -6px 0;
149
+ padding: 0;
150
+ overflow-y: auto;
151
+ list-style: none;
152
+ }
153
+
154
+ /* The panel usually sits inside the host's form, so reset what a page's own label styles may set. */
155
+ .rsp-changes label {
156
+ margin: 0;
157
+ color: var(--rsp-fg);
158
+ font-size: 14px;
159
+ font-weight: 400;
160
+ letter-spacing: 0;
161
+ text-transform: none;
162
+ display: flex;
163
+ align-items: flex-start;
164
+ gap: 10px;
165
+ padding: 6px;
166
+ border-radius: 6px;
167
+ cursor: pointer;
168
+ }
169
+
170
+ .rsp-changes label:hover {
171
+ background: var(--rsp-hover);
172
+ }
173
+
174
+ .rsp-changes input {
175
+ flex: none;
176
+ width: 16px;
177
+ height: 16px;
178
+ margin: 2px 0 0;
179
+ accent-color: var(--rsp-accent);
180
+ }
181
+
182
+ .rsp-change {
183
+ display: grid;
184
+ gap: 1px;
185
+ min-width: 0;
186
+ }
187
+
188
+ .rsp-label {
189
+ color: var(--rsp-muted);
190
+ font-size: 12px;
191
+ }
192
+
193
+ .rsp-value {
194
+ font-weight: 500;
195
+ }
196
+
197
+ .rsp-value {
198
+ overflow-wrap: anywhere;
199
+ white-space: pre-wrap;
200
+ }
201
+
202
+ .rsp-value s {
203
+ margin-right: 6px;
204
+ color: var(--rsp-muted);
205
+ }
206
+
207
+ .rsp-manual {
208
+ display: block;
209
+ box-sizing: border-box;
210
+ width: 100%;
211
+ margin-top: 10px;
212
+ padding: 8px 10px;
213
+ border: 1px solid var(--rsp-border);
214
+ border-radius: var(--rsp-radius);
215
+ background: var(--rsp-bg);
216
+ resize: vertical;
217
+ }
218
+
219
+ .rsp-actions {
220
+ display: flex;
221
+ flex-wrap: wrap;
222
+ gap: 8px;
223
+ margin-top: 12px;
224
+ }
225
+
226
+ @media (prefers-reduced-motion: reduce) {
227
+ .rsp-spinner {
228
+ animation: none;
229
+ }
230
+ }
package/package.json CHANGED
@@ -1,6 +1,88 @@
1
1
  {
2
2
  "name": "react-smart-paste",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Paste any text and let AI fill your form. A React hook and button that read the form, ask your model, preview the changes and apply them.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/SaravananAnbu/react-smart-paste.git"
9
+ },
10
+ "homepage": "https://saravanananbu.github.io/react-smart-paste/",
11
+ "bugs": {
12
+ "url": "https://github.com/SaravananAnbu/react-smart-paste/issues"
13
+ },
14
+ "keywords": [
15
+ "react",
16
+ "smart paste",
17
+ "ai",
18
+ "form",
19
+ "autofill",
20
+ "form filler",
21
+ "clipboard",
22
+ "llm",
23
+ "nextjs",
24
+ "hook"
25
+ ],
26
+ "type": "module",
27
+ "sideEffects": [
28
+ "*.css"
29
+ ],
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ },
39
+ "require": {
40
+ "types": "./dist/index.d.cts",
41
+ "default": "./dist/index.cjs"
42
+ }
43
+ },
44
+ "./server": {
45
+ "import": {
46
+ "types": "./dist/server.d.ts",
47
+ "default": "./dist/server.js"
48
+ },
49
+ "require": {
50
+ "types": "./dist/server.d.cts",
51
+ "default": "./dist/server.cjs"
52
+ }
53
+ },
54
+ "./styles.css": "./dist/styles.css",
55
+ "./package.json": "./package.json"
56
+ },
57
+ "files": [
58
+ "dist"
59
+ ],
60
+ "scripts": {
61
+ "build": "node scripts/clean.mjs && tsup && node scripts/copy-css.mjs",
62
+ "dev": "tsup --watch",
63
+ "typecheck": "tsc --noEmit",
64
+ "test": "vitest run",
65
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
66
+ },
67
+ "peerDependencies": {
68
+ "react": ">=18",
69
+ "react-dom": ">=18"
70
+ },
71
+ "devDependencies": {
72
+ "@testing-library/react": "^16.3.3",
73
+ "@types/react": "^19.3.0",
74
+ "@types/react-dom": "^19.3.0",
75
+ "jsdom": "^31.0.1",
76
+ "react": "^19.3.1",
77
+ "react-dom": "^19.3.1",
78
+ "tsup": "^9.0.0",
79
+ "typescript": "^6.0.3",
80
+ "vitest": "^5.1.0"
81
+ },
82
+ "engines": {
83
+ "node": ">=18"
84
+ },
85
+ "publishConfig": {
86
+ "access": "public"
87
+ }
88
+ }